package cn.sangyy.gift;

import org.apache.http.HttpHost;
import org.elasticsearch.client.RestClient;
import org.elasticsearch.client.RestHighLevelClient;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.context.annotation.Bean;

/**
 * @author SangYY
 * @date: 2023/03/28/17:17
 */
@SpringBootApplication
@EnableDiscoveryClient
public class SearchStart {
    public static void main(String[] args) {
        SpringApplication.run(SearchStart.class,args);
    }

    @Bean
    public RestHighLevelClient client(){
        return new RestHighLevelClient(RestClient.builder(
                HttpHost.create("http://192.168.129.130:9200")
        ));
    }
}
